<?php

namespace App\Admin\Actions\Aliyun;

use App\Admin\Forms\UpdateVersionForm;
use Dcat\Admin\Grid\RowAction;
use Dcat\Admin\Widgets\Modal;
use Throwable;

class UpdateWebVersion extends RowAction
{
    protected string $title = '版本发布';

    /**
     * @throws Throwable
     */
    public function render(): string
    {
        return Modal::make()
            ->lg()
            ->centered()
            ->title($this->row->version)
            ->body(UpdateVersionForm::make()->payload(['version_id' => $this->getKey(), 'type' => $this->row->type]))
            ->button($this->title)
            ->render();
    }
}
